package com.huluobo.a2307douyindemo

import android.app.Application
import android.util.Log
import com.hyphenate.chat.EMClient
import com.hyphenate.chat.EMOptions
import com.hyphenate.easeui.EaseIM
import com.tencent.live2.V2TXLivePremier
import com.tencent.live2.V2TXLivePremier.V2TXLivePremierObserver
import com.tencent.rtmp.TXLiveBase
import com.umeng.commonsdk.UMConfigure
import com.umeng.socialize.PlatformConfig
import dagger.hilt.android.HiltAndroidApp


/**
 *  Created by LC on 2025/9/13.
 *  68cb9d1ec261f27733229019
 *
 */
@HiltAndroidApp
class App : Application() {
    companion object {
        lateinit var instance: App
    }

    override fun onCreate() {
        super.onCreate()
        instance = this
        //友盟初始化
        UMConfigure.init(this, "68cb9d1ec261f27733229019", "umeng", UMConfigure.DEVICE_TYPE_PHONE, "")
        // QQ设置
        PlatformConfig.setQQZone("101830139", "5d63ae8858f1caab67715ccd6c18d7a5")
        val options = EMOptions()
        options.appKey = "moroks#2211mouthdemo"
//        EMClient.getInstance().init(this, options)

        //EaseIM初始化
        if (EaseIM.getInstance().init(this, options)) {
            EMClient.getInstance().setDebugMode(true)
        }

        //腾讯云初始化
        val licenceURL =
            "https://1377148799.trtcube-license.cn/license/v2/1377148799_1/v_cube.license" // 获取到的 licence url

        val licenceKey = "070810069721d089dc7f7d440aafd1e6" // 获取到的 licence key
        V2TXLivePremier.setLicence(this, licenceURL, licenceKey);
        V2TXLivePremier.setObserver(object : V2TXLivePremierObserver() {
            override fun onLicenceLoaded(result: Int, reason: String?) {
                super.onLicenceLoaded(result, reason)
                Log.i("TagA", "onLicenceLoaded: result:$result, reason:$reason");
            }
        })
    }
}